import request from '@/http/request'
/** 解除登录限制 **/
export const $deleteLoginLimit = (recordId) => {
  return request.request({
    url: '/api/sysUsers/loginLimit/' + recordId,
    method: 'delete',
  })
}
// 列表查询接口
export const $apiSysUsersList = (params) => {
  return request.request(
    { url: '/api/sysUsers', method: 'GET', params: params },
    true,
    true,
    false
  )
}

// 修改接口
export const $apiSysUsersUpdate = (bizId, data) => {
  return request.request(
    { url: '/api/sysUsers' + '/' + bizId, method: 'PUT', data: data },
    true,
    true,
    false
  )
}

// 删除接口
export const $apiSysUsersDel = (bizId) => {
  return request.request(
    { url: '/api/sysUsers' + '/' + bizId, method: 'DELETE' },
    true,
    true,
    false
  )
}
/** 更新用户角色信息 */
export const $uSysUserRoleRela = (sysUserId, roleIdList) => {
  return request.request({
    url: 'api/sysUserRoleRelas/relas/' + sysUserId,
    method: 'POST',
    data: { roleIdListStr: JSON.stringify(roleIdList) },
  })
}
// 列表查询接口
export const $apiSysRolesList = (params) => {
  return request.request(
    { url: '/api/sysRoles', method: 'GET', params: params },
    true,
    true,
    true
  )
}
// 列表查询接口
export const $apiSysUserRoleRelasList = (params) => {
  return request.request(
    { url: '/api/sysUserRoleRelas', method: 'GET', params: params },
    true,
    true,
    false
  )
}

/** 拓展员商户统计数据*/
export const $userChart = (sysUserId, queryDateRange) => {
  return request.request({
    url: '/api/mainChart/userChart',
    method: 'GET',
    params: { sysUserId, queryDateRange },
  })
}

// 查询单条数据接口
export const $getApiSysUsers = (bizId, params = {}) => {
  return request.request(
    { url: '/api/sysUsers' + '/' + bizId, method: 'GET', params: params },
    true,
    true,
    false
  )
}
// 新增接口
export const $apiSysUsersAdd = (data) => {
  return request.request(
    { url: '/api/sysUsers', method: 'POST', data: data },
    true,
    true,
    false
  )
}

// 通用列表查询接口
export const $apiUserTeamsList = (params) => {
  return request.request(
    { url: '/api/userTeams', method: 'GET', params: params },
    true,
    true,
    true
  )
}

// 验证操作员手机号 发送手机验证码
export const $apiSmsSendMsgAdd = (data) => {
  return request.request(
    { url: '/api/sms/smsCode', method: 'POST', data: data },
    true,
    true,
    false
  )
}

export const $getPasswordRules = () => {
  return request.request({
    url: '/api/anon/cipher/pwdRulesRegexp',
    method: 'get',
  })
}
